
package com.github.ybq.parallaxviewpager.Interpolator;

/**
 * Overshoot interpolator
 */
public class OvershootInterpolator extends BaseInterpolator {
    /**
     * M tension
     */
    private final float mTension;

    /**
     * Overshoot interpolator
     */
    public OvershootInterpolator() {
        mTension = 2.0f;
    }

    /**
     * Overshoot interpolator
     *
     * @param tension tension
     */
    public OvershootInterpolator(float tension) {
        mTension = tension;
    }


    /**
     * Get interpolation float
     *
     * @param input input
     * @return the float
     */
    public float getInterpolation(float input) {
        input -= 1.0f;
        return input * input * ((mTension + 1) * input + mTension) + 1.0f;
    }


}

